import request from '@/config/axios'

// 设计方案 VO
export interface DesignPlanVO {
  id: number // 主键
  titleZhCn: string // 中文标题
  titleEnUs: string // 英文标题
  showImages: string // 图片（多个逗号分隔）
  contentZhCn: string // 内容中文详情
  contentEnUs: string // 内容英文详情
}

// 设计方案 API
export const DesignPlanApi = {
  // 查询设计方案分页
  getDesignPlanPage: async (params: any) => {
    return await request.get({ url: `/business/design-plan/page`, params })
  },

  // 查询设计方案详情
  getDesignPlanAll: async () => {
    return await request.get({ url: `/business/design-plan/list` })
  },

  // 查询设计方案详情
  getDesignPlan: async (id: number) => {
    return await request.get({ url: `/business/design-plan/get?id=` + id })
  },

  // 新增设计方案
  createDesignPlan: async (data: DesignPlanVO) => {
    return await request.post({ url: `/business/design-plan/create`, data })
  },

  // 修改设计方案
  updateDesignPlan: async (data: DesignPlanVO) => {
    return await request.put({ url: `/business/design-plan/update`, data })
  },

  // 删除设计方案
  deleteDesignPlan: async (id: number) => {
    return await request.delete({ url: `/business/design-plan/delete?id=` + id })
  },

  // 导出设计方案 Excel
  exportDesignPlan: async (params) => {
    return await request.download({ url: `/business/design-plan/export-excel`, params })
  },
}
